<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<link type="text/css" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css" rel="stylesheet"/>
<title>New Faculty page</title>
</head>
<body>

<%! private String temp = "Mike";%>
  <nav class="navbar navbar-inverse" role="navigation">
  <ul class="nav navbar-nav">
 	  <li class="active"><a href="${pageContext.request.contextPath}/register/list.html">Job</a></li>
 	  <c:set var="faculty" value="${type}"/>   
		<jsp:useBean id="faculty" type="java.lang.String" />
		<c:if test='<%=faculty.equalsIgnoreCase("faculty")%>'>
      <li><a href="${pageContext.request.contextPath}/faculty/list.html">Faculty</a></li>
       </c:if>
      </ul>
      
      <ul class="nav navbar-nav navbar-right">
       <c:set var="str" value="${type}"/>   
		<jsp:useBean id="str" type="java.lang.String" />
		<c:if test='<%=str.equalsIgnoreCase("faculty")%>'>
      <li><a href="${pageContext.request.contextPath}/register/create.html">New</a></li>
      <li><a href="${pageContext.request.contextPath}/register/edit/${position.positionID}.html">Edit</a></li>
       <li><a href="${pageContext.request.contextPath}/register/delete/${position.positionID}.html">Delete</a></li>
      </c:if>
     	
  	<c:set var="strr" value="${type}"/>   
		<jsp:useBean id="strr" type="java.lang.String" />
		<c:if test='<%=str.equalsIgnoreCase("student")%>'>
    	<li><a href="">Apply</a></li>
    	<li class="active"><a href="${pageContext.request.contextPath}/student/view.html">cancel</a></li>
      </c:if> 
    </ul>
</nav>

<form:form method="POST" commandName="register" action="${pageContext.request.contextPath}/register/view/${position.positionID}.html" >

<div class="panel panel-default">
  <div class="panel-heading">Title</div>
  <div class="panel-body">
<table>
<tbody>
<tr>
<p>Title: ${position.title}</p>
</tr>
</tbody>
</table>
  </div>
</div>


<div class="panel panel-default">
  <div class="panel-heading">Position Information</div>
  <div class="panel-body">
<table>
<tbody>
<tr>
<p>Type: ${position.type}</p>

<p>Department: ${position.department}</p>

<p>Hourly Rate: $${position.hourlyRate}</p>
</tr>
</tbody>
</table>
  </div>
</div>

<div class="panel panel-default">
  <div class="panel-heading">Times Available</div>
  <div class="panel-body">
<table>
<tbody>
<tr>

<p>Sunday From: ${schedule.sundayFrom} Sunday To: ${schedule.sundayTo}</p>

<p>Monday From: ${schedule.mondayFrom} Monday To: ${schedule.mondayTo}</p>

<p>Tuesday From: ${schedule.tuesdayFrom} Tuesday To: ${schedule.tuesdayTo}</p>

<p>Wednesday From: ${schedule.wednesdayFrom} Wednesday To: ${schedule.wednesdayTo}</p>

<p>Thursday From: ${schedule.thursdayFrom} Thursday To: ${schedule.thursdayTo}</p>

<p>Friday From: ${schedule.fridayFrom} Friday To: ${schedule.fridayTo}</p>

<p>Saturday From: ${schedule.saturdayFrom} Saturday To: ${schedule.saturdayTo}</p>

  </div>
</div>

</tbody>
</table>
  </div>
</div>

	<c:set var="student" value="${type}"/>   
		<jsp:useBean id="student" type="java.lang.String" />
		<c:if test='<%=str.equalsIgnoreCase("faculty")%>'>
		      
		<div class="list-group">
		  <a href="#" class="list-group-item active">
		    Students
		  </a>
		<c:forEach var="student" items="${studentList}">
		  <a href="${pageContext.request.contextPath}/student/view/${student.studentID}" class="list-group-item"> Name: ${student.firstName}  ${student.lastName} | Email: ${student.email}</a>
		</c:forEach>
		</div>
	</c:if>
</form:form>

</body>
</html>